<?php
/**
 * Created by IntelliJ IDEA.
 * User: wanglu
 * Date: 17/4/12
 * Time: 17:43
 */
class Project_version_model extends BaseModel {



    function __construct()
    {
        parent::__construct(Db_model::TABLE_PROJECT_VERSION);
    }

    public function get_max_version($pid) {
         $version = $this->db->select_max('version')
            ->where('pid', $pid)
            ->get($this->recordTable)
             ->row_array();


        if (empty($version)) {
            return 0 ;
        }
        return $version['version'];
    }

    

}